package com.wc.acwing.思维.Q5483_截断数组;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/3/10 9:25
 * @description https://www.acwing.com/problem/content/5483/
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 110;
    static int[] a = new int[N];
    static int n, b;

    public static void main(String[] args) {
        n = sc.nextInt();
        b = sc.nextInt();
        PriorityQueue<Integer> q = new PriorityQueue<>(Comparator.reverseOrder());
        for (int i = 1; i <= n; i++) a[i] = sc.nextInt();
        int odd = 0;
        int even = 0;
        a[n + 1] = 100000;
        for (int i = 1; i <= n; i++) {
            if ((a[i] & 1) == 1) even++;
            else odd++;
            if (even == odd) {
                int val = Math.abs(a[i + 1] - a[i]);
                if (b >= val) {
                    b -= val;
                    q.add(Math.abs(a[i + 1] - a[i]));
                } else if (!q.isEmpty() && q.peek() > val) {
                    b += q.poll();
                    b -= val;
                    q.add(val);
                }
            }
        }
        out.println(q.size());
        out.flush();
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
